import request from '@/config/axios'

// ERP销售管理-客户报价单 VO
export interface SaleCustomerQuotationVO {
  id: string // ID
  quotationNo: string // 报价单号
  customerId: string // 客户id
  customerName: string // 客户名称
  auditStatus: boolean // 审核
  quotationUnit: string // 报价单位
  discount: number // 折扣
  currency: string // 币别
  effectiveDate: Date // 生效日期
  pricingPlan: string // 计价方案
  remark: string // 备注
}

// ERP销售管理-客户报价单 API
export const SaleCustomerQuotationApi = {
  // 查询ERP销售管理-客户报价单分页
  getSaleCustomerQuotationPage: async (params: any) => {
    return await request.get({ url: `/erp/sale-customer-quotation/page`, params })
  },

  // 查询ERP销售管理-客户报价单详情
  getSaleCustomerQuotation: async (id: number) => {
    return await request.get({ url: `/erp/sale-customer-quotation/get?id=` + id })
  },

  // 新增ERP销售管理-客户报价单
  createSaleCustomerQuotation: async (data: SaleCustomerQuotationVO) => {
    return await request.post({ url: `/erp/sale-customer-quotation/create`, data })
  },

  // 修改ERP销售管理-客户报价单
  updateSaleCustomerQuotation: async (data: SaleCustomerQuotationVO) => {
    return await request.put({ url: `/erp/sale-customer-quotation/update`, data })
  },

  // 删除ERP销售管理-客户报价单
  deleteSaleCustomerQuotation: async (id: number) => {
    return await request.delete({ url: `/erp/sale-customer-quotation/delete?id=` + id })
  },

  // 导出ERP销售管理-客户报价单 Excel
  exportSaleCustomerQuotation: async (params) => {
    return await request.download({ url: `/erp/sale-customer-quotation/export-excel`, params })
  },

// ==================== 子表（ERP销售管理-客户报价盒式） ====================

  // 获得ERP销售管理-客户报价盒式分页
  getSaleCustomerQuotationBoxPage: async (params) => {
    return await request.get({ url: `/erp/sale-customer-quotation/sale-customer-quotation-box/page`, params })
  },
  // 新增ERP销售管理-客户报价盒式
  createSaleCustomerQuotationBox: async (data) => {
    return await request.post({ url: `/erp/sale-customer-quotation/sale-customer-quotation-box/create`, data })
  },

  // 修改ERP销售管理-客户报价盒式
  updateSaleCustomerQuotationBox: async (data) => {
    return await request.put({ url: `/erp/sale-customer-quotation/sale-customer-quotation-box/update`, data })
  },

  // 删除ERP销售管理-客户报价盒式
  deleteSaleCustomerQuotationBox: async (id: number) => {
    return await request.delete({ url: `/erp/sale-customer-quotation/sale-customer-quotation-box/delete?id=` + id })
  },

  // 获得ERP销售管理-客户报价盒式
  getSaleCustomerQuotationBox: async (id: number) => {
    return await request.get({ url: `/erp/sale-customer-quotation/sale-customer-quotation-box/get?id=` + id })
  },

// ==================== 子表（ERP销售管理-客户报价材质信息） ====================

  // 获得ERP销售管理-客户报价材质信息分页
  getSaleCustomerQuotationMaterialPage: async (params) => {
    return await request.get({ url: `/erp/sale-customer-quotation/sale-customer-quotation-material/page`, params })
  },
  // 新增ERP销售管理-客户报价材质信息
  createSaleCustomerQuotationMaterial: async (data) => {
    return await request.post({ url: `/erp/sale-customer-quotation/sale-customer-quotation-material/create`, data })
  },

  // 修改ERP销售管理-客户报价材质信息
  updateSaleCustomerQuotationMaterial: async (data) => {
    return await request.put({ url: `/erp/sale-customer-quotation/sale-customer-quotation-material/update`, data })
  },

  // 删除ERP销售管理-客户报价材质信息
  deleteSaleCustomerQuotationMaterial: async (id: number) => {
    return await request.delete({ url: `/erp/sale-customer-quotation/sale-customer-quotation-material/delete?id=` + id })
  },

  // 获得ERP销售管理-客户报价材质信息
  getSaleCustomerQuotationMaterial: async (id: number) => {
    return await request.get({ url: `/erp/sale-customer-quotation/sale-customer-quotation-material/get?id=` + id })
  },

// ==================== 子表（ERP销售管理-报价明细产品信息） ====================

  // 获得ERP销售管理-报价明细产品信息分页
  getSaleCustomerQuotationProductPage: async (params) => {
    return await request.get({ url: `/erp/sale-customer-quotation/sale-customer-quotation-product/page`, params })
  },
  // 新增ERP销售管理-报价明细产品信息
  createSaleCustomerQuotationProduct: async (data) => {
    return await request.post({ url: `/erp/sale-customer-quotation/sale-customer-quotation-product/create`, data })
  },

  // 修改ERP销售管理-报价明细产品信息
  updateSaleCustomerQuotationProduct: async (data) => {
    return await request.put({ url: `/erp/sale-customer-quotation/sale-customer-quotation-product/update`, data })
  },

  // 删除ERP销售管理-报价明细产品信息
  deleteSaleCustomerQuotationProduct: async (id: number) => {
    return await request.delete({ url: `/erp/sale-customer-quotation/sale-customer-quotation-product/delete?id=` + id })
  },

  // 获得ERP销售管理-报价明细产品信息
  getSaleCustomerQuotationProduct: async (id: number) => {
    return await request.get({ url: `/erp/sale-customer-quotation/sale-customer-quotation-product/get?id=` + id })
  },

// ==================== 子表（ERP销售管理-客户报价原纸信息） ====================

  // 获得ERP销售管理-客户报价原纸信息分页
  getCustomerQuotationPaperPage: async (params) => {
    return await request.get({ url: `/erp/sale-customer-quotation/customer-quotation-paper/page`, params })
  },
  // 新增ERP销售管理-客户报价原纸信息
  createCustomerQuotationPaper: async (data) => {
    return await request.post({ url: `/erp/sale-customer-quotation/customer-quotation-paper/create`, data })
  },

  // 修改ERP销售管理-客户报价原纸信息
  updateCustomerQuotationPaper: async (data) => {
    return await request.put({ url: `/erp/sale-customer-quotation/customer-quotation-paper/update`, data })
  },

  // 删除ERP销售管理-客户报价原纸信息
  deleteCustomerQuotationPaper: async (id: number) => {
    return await request.delete({ url: `/erp/sale-customer-quotation/customer-quotation-paper/delete?id=` + id })
  },

  // 获得ERP销售管理-客户报价原纸信息
  getCustomerQuotationPaper: async (id: number) => {
    return await request.get({ url: `/erp/sale-customer-quotation/customer-quotation-paper/get?id=` + id })
  },

  // 获取所有客户
  getAllBaseCustomer: async () => {
    return await request.get({ url: `/erp/sale-customer-quotation/list-all-customer` })
  },

  // 获取所有材质
  getAllBaseMaterial: async () => {
    return await request.get({ url: `/erp/sale-customer-quotation/list-all-material` })
  },

  // 获取所有箱型
  getAllBaseBoxType: async () => {
    return await request.get({ url: `/erp/sale-customer-quotation/list-all-box-type` })
  },
}
